<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            font-size: 16px;
        }
        html{
            font-size: 26.66vm;
        }
        #box{
            width: 1rem;
            height: 1rem;
            background: rebeccapurple;
        }
    </style>
</head>
<body >
    <div id="box"></div>
    <!-- 动态设置font-size -->
    <script>
       var scale=document.documentElement.clientWidth/375
       document.documentElement.style.fontSize=scale+'px'
    </script>
</body>
</html>